package com.df.common.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import org.springframework.transaction.annotation.Transactional;

import java.util.Collection;
import java.util.List;

public interface BaseService<T> {

    List<T> getList4Like(T temp);

    List<T> getList(T temp);

    T getOne(T temp);

    Long getCount(T temp);

    /**
     * 新增
     * @param temp  实体类
     * @return  受影响行数
     * @version 240222A
     */
    @Transactional(rollbackFor = Exception.class)
    int add(T temp);

    @Transactional(rollbackFor = Exception.class)
    int update(T temp);

    @Transactional(rollbackFor = Exception.class)
    int delete(Collection<?> ids);

    @Transactional(rollbackFor = Exception.class)
    int delete(Wrapper<T> queryWrapper);
}